from django.urls import path
from .views import *


urlpatterns = [
    # # 入驻申请
    path('register/', ShopsView.as_view({"post": "user_register"})),
    # 获取单个商家用户信息
    path('userinfo/', ShopsView.as_view({"get": "shops_dict", "put": "up_user"})),
    # 获取所有商家信息
    path('info/', ShopsView.as_view({"get": "shops"})),
    path('userinfo/<int:pk>/', ShopsView.as_view({"get": "shops_desc"})),

    # 商品类别
    path('goods_type/', GoodsTypeView.as_view({"get":"list","post":"add","put":"update"})),
    path('goods_type/<int:pk>', GoodsTypeView.as_view({"delete":"delete"})),
    # 商品
    path('goods/', GoodsView.as_view({"get":"list","post":"add","put":"update"})),
    path('goods/<int:pk>', GoodsView.as_view({"delete":"delete"})),

    # 订单
    path('order/',OrderViewSet.as_view({'get':'get_order'})),
    # 获取未支付的订单
    path('order_pay/',OrderViewSet.as_view({'get':'check_order'})),
    # 获取已支付的订单
    path('pay_order/',OrderViewSet.as_view({'get':'order_check'})),
    # 获取订单详情
    path('order/<int:pk>/',OrderViewSet.as_view({'get':'order_desc'})),
]